//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Departments, DepartmentsResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooDepartmentsList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<DepartmentsResponse>(`/uctoo/departments/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooDepartments = async (id: string) => {
  return requestClient.get<Departments>(`/uctoo/departments/${id}`);
};

export const adductooDepartments = async (data: Partial<Departments>) => {
  return requestClient.post<Departments>('/uctoo/departments/add', data);
};

export const edituctooDepartments = async (data: Partial<Departments>) => {
  return requestClient.post<Departments>('/uctoo/departments/edit', data);
};

export const deleteuctooDepartments = async (id: string) => {
  return requestClient.post<any>('/uctoo/departments/del', { id });
};
